/**
 * 所有版权归 广西梧州 陈锦韬 所有
 *
 * @Title: RxArgumentHandler
 * @Package com.rx.core.covert
 * @Description: 控制层参数处理器
 * @author: 陈锦韬
 * @date: 2021/6/10
 * @version V1.0
 * @Copyright: 2021 陈锦韬  All rights reserved.
 */
package com.rx.core.covert;

import com.rx.core.anno.RxArgumentHandler;
import org.springframework.core.MethodParameter;
import org.springframework.web.bind.support.WebDataBinderFactory;
import org.springframework.web.context.request.NativeWebRequest;
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.method.support.ModelAndViewContainer;
import org.springframework.web.servlet.support.RequestContextUtils;

/**
 * @author: CHENJINTAO170
 * @Description: 控制层参数处理器
 * @date: 2021/6/10
 */
public class RxArgumentHandlerResolver implements HandlerMethodArgumentResolver {
    @Override
    public boolean supportsParameter(MethodParameter parameter) {
        return parameter.hasParameterAnnotation(RxArgumentHandler.class);
    }

    @Override
    public Object resolveArgument(MethodParameter parameter,
                                  ModelAndViewContainer mavContainer,
                                  NativeWebRequest webRequest,
                                  WebDataBinderFactory binderFactory) throws Exception {
        //RequestContextUtils.
        return "测算";
    }
}
